home *** CD-ROM | disk | FTP | other *** search
- package java.io;
-
- class ObjectInputStream$GetFieldImpl extends ObjectInputStream.GetField {
- private final ObjectStreamClass desc;
- private final byte[] primVals;
- private final Object[] objVals;
- private final int[] objHandles;
- // $FF: synthetic field
- final ObjectInputStream this$0;
-
- ObjectInputStream$GetFieldImpl(ObjectInputStream var1, ObjectStreamClass var2) {
- this.this$0 = var1;
- this.desc = var2;
- this.primVals = new byte[var2.getPrimDataSize()];
- this.objVals = new Object[var2.getNumObjFields()];
- this.objHandles = new int[this.objVals.length];
- }
-
- public ObjectStreamClass getObjectStreamClass() {
- return this.desc;
- }
-
- public boolean defaulted(String var1) throws IOException {
- return this.getFieldOffset(var1, (Class)null) < 0;
- }
-
- public boolean get(String var1, boolean var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Boolean.TYPE);
- return var3 >= 0 ? Bits.getBoolean(this.primVals, var3) : var2;
- }
-
- public byte get(String var1, byte var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Byte.TYPE);
- return var3 >= 0 ? this.primVals[var3] : var2;
- }
-
- public char get(String var1, char var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Character.TYPE);
- return var3 >= 0 ? Bits.getChar(this.primVals, var3) : var2;
- }
-
- public short get(String var1, short var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Short.TYPE);
- return var3 >= 0 ? Bits.getShort(this.primVals, var3) : var2;
- }
-
- public int get(String var1, int var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Integer.TYPE);
- return var3 >= 0 ? Bits.getInt(this.primVals, var3) : var2;
- }
-
- public float get(String var1, float var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Float.TYPE);
- return var3 >= 0 ? Bits.getFloat(this.primVals, var3) : var2;
- }
-
- public long get(String var1, long var2) throws IOException {
- int var4 = this.getFieldOffset(var1, Long.TYPE);
- return var4 >= 0 ? Bits.getLong(this.primVals, var4) : var2;
- }
-
- public double get(String var1, double var2) throws IOException {
- int var4 = this.getFieldOffset(var1, Double.TYPE);
- return var4 >= 0 ? Bits.getDouble(this.primVals, var4) : var2;
- }
-
- public Object get(String var1, Object var2) throws IOException {
- int var3 = this.getFieldOffset(var1, Object.class);
- if (var3 >= 0) {
- int var4 = this.objHandles[var3];
- ObjectInputStream.access$100(this.this$0).markDependency(ObjectInputStream.access$000(this.this$0), var4);
- return ObjectInputStream.access$100(this.this$0).lookupException(var4) == null ? this.objVals[var3] : null;
- } else {
- return var2;
- }
- }
-
- void readFields() throws IOException {
- ObjectInputStream.access$200(this.this$0).readFully(this.primVals, 0, this.primVals.length, false);
- int var1 = ObjectInputStream.access$000(this.this$0);
- ObjectStreamField[] var2 = this.desc.getFields(false);
- int var3 = var2.length - this.objVals.length;
-
- for(int var4 = 0; var4 < this.objVals.length; ++var4) {
- this.objVals[var4] = ObjectInputStream.access$300(this.this$0, var2[var3 + var4].isUnshared());
- this.objHandles[var4] = ObjectInputStream.access$000(this.this$0);
- }
-
- ObjectInputStream.access$002(this.this$0, var1);
- }
-
- private int getFieldOffset(String var1, Class var2) {
- ObjectStreamField var3 = this.desc.getField(var1, var2);
- if (var3 != null) {
- return var3.getOffset();
- } else if (this.desc.getLocalDesc().getField(var1, var2) != null) {
- return -1;
- } else {
- throw new IllegalArgumentException("no such field " + var1 + " with type " + var2);
- }
- }
- }
-